import * as http from "http";

function server_main(params: any) {
  const tag = "server:";
  console.log(tag);
  const server = http.createServer((req, res) => {
    console.log(tag, req.toString(), res.toString());
    res.statusCode = 200;
    res.setHeader("content-type", "text/plain");
    res.end("My Hello World\n");
  });
  const port = 8999;
  server.listen(port, () => {
    console.log(`Server is listening : ${port}`);
    var result = server.address();
    console.log(`address: ${result}`);
  });
}

export { server_main };
